package com.sts.controller;

import com.sts.dto.PermissionDTO;
import com.sts.service.PermissionService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.w3c.dom.stylesheets.LinkStyle;

import java.util.List;

@RestController
@RequestMapping("/permission")
@RequiredArgsConstructor
public class PermissionController {
    private final PermissionService permissionService;
    @GetMapping("/list")
    @PreAuthorize("hasRole('ADMIN')")
    public List<PermissionDTO> list(){
        return permissionService.list();
    }
}
